<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       *{
           margin: 0;
           padding: 0;
       }

       body{
           background: url(/imge/1.jpg) no-repeat center top;
       }

       li{
            list-style: none;
       }
        .baidu{
            overflow: hidden;
            margin: 100px auto;
            background-color: #fff;
            width: 410px;
            padding-top: 3px;
        }
        .baidu li {
            float: left;
            margin: 0 1px;
            cursor: pointer;
        }

        .baidu img {
            width: 100px;
        }
    </style>
</head>
<body>
    <ul class="baidu">
        <li><img src="/imge/1.jpg" alt=""></li>
        <li><img src="/imge/2.jpg" alt=""></li>
        <li><img src="/imge/3.jpg" alt=""></li>
        <li><img src="/imge/4.jpg" alt=""></li>
    </ul>
    <script>
        var imgs = document.getElementsByTagName('img');
        var body = document.querySelector('body')
        for(var i = 0;i<imgs.length;i++){
            imgs[i].onclick = function(){
                body.style.backgroundImage = 'url('+this.src+')';
            }
        }
    </script>
</body>
</html>